package interDemo;
class Hero extends ActionCharacter implements CanFly, CanSwim {
    String name;
    public Hero(String name) {
        this.name = name;
    }
    @Override
    public void fly() {
        System.out.println(name + "飞行");
    }
    @Override
    public void swim() {
        System.out.println(name + "游泳");
    }
    public void fight(String emp) {
        System.out.println(name + "攻击" + emp);
    }
}
        class Adventrue {
            public static void main(String[] args) {
                Hero hb = new Hero("好人");
                hb.swim();
                hb.fight("坏人");
                hb.fly();
                CanFly cf = hb;
                cf.fly();
                CanSwim cs = hb;
                cs.swim();
                ActionCharacter ac = hb;
                ac.fight("坏人");
                ac.speak("救命");
            }
        }
